#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author   : BUZAI
# @Time     : 2021/7/7 21:07
from selenium.webdriver.common.by import By


class TxSearchContent():
    def __init__(self,driver):
        self.driver=driver

    def input_content(self):
        '''输入搜索内容'''
        self.driver.find_element(By.XPATH,'//android.widget.EditText[@resource-id="com.tencent.news:id/cdw"]').send_keys('爱人')
    def click_ok(self):
        '''确定搜索'''
        self.driver.press_keycode(66)
    def content_search(self):
        '''点击搜索到的内容'''
        self.driver.find_element(By.XPATH,'//android.view.View[@text="影子爱人"]').click()
    def give_like(self):
        '''点赞'''
        self.driver.find_element(By.XPATH,'//android.widget.TextView[@resource-id="com.tencent.news:id/aup"]').click()